package com.fqy.gmall.product.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fqy.gmall.model.product.BaseTrademark;
import com.fqy.gmall.product.mapper.BaseTradeMapper;
import com.fqy.gmall.product.service.BaseTrademarkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * User: fqy
 * Date: 2021/9/10
 * Time: 23:07
 * Describe:
 */
@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTradeMapper, BaseTrademark> implements BaseTrademarkService {

    @Autowired
    private BaseTradeMapper baseTradeMapper;

    //获取品牌分页列表
    @Override
    public IPage getTradeMarkPage(Page<BaseTrademark> baseTrademarkPage) {
        //获取品牌分页列表 base_trademark
        //select * from base_trademark limit 0 , 10;
        QueryWrapper<BaseTrademark> baseTradeQueryWrapper = new QueryWrapper<>(null);
        baseTradeQueryWrapper.orderByDesc("id");
        Page<BaseTrademark> trademarkPage = baseTradeMapper.selectPage(baseTrademarkPage, baseTradeQueryWrapper);
        return trademarkPage;
    }
}
